﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Threading;

namespace SAR
{
    public partial class HuiboMoni8:BasePageClass
    {
        public HuiboMoni8()
        {
            this.InitializeComponent();
            this.progressBar.SARProgressValue = 0;
            this.Loaded += new RoutedEventHandler(HuiboMoni_Loaded);
        }
        public bool PreClick()
        {
            return true;
        }

        public bool NextClick()
        {

            return true;
        }

        void HuiboMoni_Loaded(object sender, RoutedEventArgs e)
        {
            Timer timer = new Timer(new TimerCallback(timerHandlerMethod));
            timer.Change(100, 100);
        }

        private void timerHandlerMethod(object arg)
        {
            this.Dispatcher.Invoke(new TickDelegate(triggerTickMethod), null);
        }

        private void triggerTickMethod()
        {
            if (this.progressBar.SARProgressValue < 1)
            {
                this.progressBar.SARProgressValue += 0.01;
            }
        }

        private void progressBar_SARStartClick(object sender, MouseButtonEventArgs e)
        {
            this.progressBar.SARProgressValue = 0;
        }
        public delegate void TickDelegate();
    }
}